/*    */ package com.zimbra.cs.filter;
/*    */ 
/*    */ import org.apache.jsieve.parser.SieveNode;
/*    */ import org.apache.jsieve.parser.generated.Node;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class FolderDeleted
/*    */   extends SieveVisitor
/*    */ {
/*    */   private String mDeletedFolderPath;
/*    */   private Node mIfNode;
/* 31 */   private boolean mModified = false;
/*    */   
/*    */   public FolderDeleted(String deletedFolderPath) {
/* 34 */     this.mDeletedFolderPath = FolderRenamer.prefixWithSlash(deletedFolderPath);
/*    */   }
/*    */   
/*    */   public boolean modified() {
/* 38 */     return this.mModified;
/*    */   }
/*    */   
/*    */   protected void visitNode(Node node, SieveVisitor.VisitPhase phase, SieveVisitor.RuleProperties props)
/*    */   {
/* 43 */     if (phase != SieveVisitor.VisitPhase.begin) {
/* 44 */       return;
/*    */     }
/* 46 */     String name = getNodeName(node);
/* 47 */     if (("if".equals(name)) || ("disabled_if".equals(name)))
/*    */     {
/* 49 */       this.mIfNode = node;
/*    */     }
/*    */   }
/*    */   
/*    */ 
/*    */   protected void visitFileIntoAction(Node node, SieveVisitor.VisitPhase phase, SieveVisitor.RuleProperties props, String folderPath)
/*    */   {
/* 56 */     if (phase != SieveVisitor.VisitPhase.begin) {
/* 57 */       return;
/*    */     }
/* 59 */     folderPath = FolderRenamer.prefixWithSlash(folderPath);
/* 60 */     String ifNodeName = getNodeName(this.mIfNode);
/* 61 */     if ((folderPath.startsWith(this.mDeletedFolderPath)) && ("if".equals(ifNodeName))) {
/* 62 */       ((SieveNode)this.mIfNode).setName("disabled_if");
/* 63 */       this.mModified = true;
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/filter/FolderDeleted.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */